package com.har.modules.web.controller;

import com.har.common.utils.R;
import com.har.modules.web.entity.OrderEntity;
import com.har.modules.web.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



/**
 * 保险产品订单表
 *
 * @author macwy
 * @email 
 * @date 2018-07-26 09:08:17
 */
@RestController
@RequestMapping("business/order")
public class OrderController {
    @Autowired
    private OrderService orderService;




    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id) {
        OrderEntity order = orderService.selectById(id);

        return R.ok().put("order", order);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody OrderEntity order) {
        orderService.insert(order);

        return R.ok();

    }
}